package cn.sdormitory.tencent;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @className: TencentCosConstantUtils
 * @author: Alex
 * @date: 2023/9/9
 **/
@Component
public class TencentCosConstantUtils implements InitializingBean {
	
	@Value("${tencent.cos.file.region}")
	private String region;
	
	@Value("${tencent.cos.file.secretId}")
	private String secretId;
	
	@Value("${tencent.cos.file.secretKey}")
	private String secretKey;
	
	@Value("${tencent.cos.file.bucketName}")
	private String bucketName;
	
	public static String REGION;
	public static String ACCESS_KEY_ID;
	public static String ACCESS_KEY_SECRET;
	public static String BUCKET_NAME;
	
	@Override
	public void afterPropertiesSet() throws Exception {
		REGION = region;
		ACCESS_KEY_ID = secretId;
		ACCESS_KEY_SECRET = secretKey;
		BUCKET_NAME = bucketName;
	}
}
